﻿//bbs 
var cloudad_type2 = 'ms518';
var cloudad_urls2 = [
'http://ad.csdn.net/adsrc/ibm-ca-q2-x3650m4-download-thefinalpage-728-90-0523.swf'
];
var cloudad_clks2 = [
'http://e.cn.miaozhen.com/r.gif?k=1005670&p=3yRzo0&rt=2&ns=[M_ADIP]&ni=[M_IESID]&na=[M_MAC]&o=http://ad-apac.doubleclick.net/click;h=v2|40A0|0|0|%2a|t;271458812;0-0;0;97273205;31-1|1;53954951|53863946|1;;%3fhttp://www.ibm.com/systems/cn/promotion/esg/xseries/newgeneration/banner.shtml?csr=apch_cfg2_20130422_1366612960996&ck=csdn&cmp=132pm&ct=132pm04w&cr=csdn&cm=b&csot=-&ccy=cn&cpb=-&cd=2013-04-18&cot=a&cpg=pm&cn=intel-_es__x3650_m4_csdn_download_the_final_page_banner&csz=728*90&co=flash'
];

var can_swf2 = (function () {
    if (document.all) swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
    else if (navigator.plugins) swf = navigator.plugins["Shockwave Flash"];
    return !!swf;
})();

function cloudad_show2() {
    var rd = Math.random();
    var ad_url, log_url;
    if (rd < 0.4 && can_swf2) {
        ad_url = cloudad_urls2[0];

        log_url = 'http://ad.csdn.net/log.ashx';
        log_url += '?t=view&adtype=' + cloudad_type2 + '&adurl=' + encodeURIComponent(ad_url);
        cloudad_doRequest2(log_url, true);
    }
    if (rd < 0.005) {
        ad_url = cloudad_clks2[0];

        log_url = 'http://ad.csdn.net/log.ashx';
        log_url += '?t=click&adtype=' + cloudad_type2 + '&adurl=' + encodeURIComponent(ad_url);
        cloudad_doRequest2(log_url, true);
    }
}

function cloudad_doRequest2(url, useFrm) {
    var e = document.createElement(useFrm ? "iframe" : "img");

    e.style.width = "1px";
    e.style.height = "1px";
    e.style.position = "absolute";
    e.style.visibility = "hidden";

    if (url.indexOf('?') > 0) url += '&r_m=';
    else url += '?r_m=';
    url += new Date().getMilliseconds();
    e.src = url;

    document.body.appendChild(e);
}

setTimeout(function () {
    cloudad_show2();
}, 1000);
